package com.azt.api.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 报价单状态
 * @author Snowler  2016年10月27日下午3:42:52
 */
public enum EnqQuoteEnum {

	/*状态 0.审核中（待审核）1.比价中（审核能过） 2.已取消3.审核未通过4.已下单5.报价未采纳6.询价已取消*/
	QUT_STAY(0, "审核中"), QUT_POSTED(1, "比价中"), QUT_CLOSE(2, "已取消")
	, QUT_REFUSE(3 , "未通过") , QUT_ORDER( 4 , "已下单")
	, QUT_UN_ADOPT( 5 , "报价未采纳") , QUT_ENQ_CLOSE( 6 , "询价已取消");


	private int index;
	private String name;

	private EnqQuoteEnum(int index, String name) {
		this.index = index;
		this.name = name;
	}
	

	/**
	 * 获取所有角色
	 * @return
	 */
	public static Map<String, String> getAllQuoteStat(){
		Map<String, String>  projects = new HashMap<String,String>();
		for (EnqQuoteEnum c : EnqQuoteEnum.values()) {
			projects.put(c.getIndex()+"", c.getName());
		}
		return projects;
	}
	
	
	public static String getName(int index) {
		for (EnqQuoteEnum c : EnqQuoteEnum.values()) {
			if (c.getIndex() == index) {
				return c.name;
			}
		}
		return null;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
